Add zstd to makefile routing#1802
Conversation
| @if [ "$(enable_orafce)" = "yes" ]; then \ | ||
| $(MAKE) -C orafce NO_PGXS=true install; \ | ||
| fi | ||
| @if [ "$(with_zstd)" = "yes" ]; then \ |
There was a problem hiding this comment.
Hi @reshke thanks for the patch!
▎ How does it even work without this?
It works through the recurse mechanism that's already in place. A few lines above in the same Makefile:
ifeq "$(with_zstd)" "yes"
recurse_targets += zstd
endif
...
The recurse function (defined in src/Makefile.global.in) uses $(eval) to generate, for each target/subdir pair:
install: install-zstd-recurse
install-zstd-recurse: submake-generated-headers
$(MAKE) -C zstd install
Since GNU make allows adding prerequisites to a target whose recipe is defined elsewhere, the explicit install: recipe below picks up
install-zstd-recurse as a prerequisite — so make install already descends into zstd/ before running the gpcloud/mapreduce/pxf/orafce steps. Same for
all, clean, and distclean.
This is easy to verify with a dry run:
$ make -n -C gpcontrib install | grep "zstd install"
make -C zstd install
With this patch applied, make -C zstd install (and clean) would run twice — harmless, but redundant.
How does it even work without this?